package com.qf.feigns;

import com.qf.pojo.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OrderApiFallbackFactory implements FallbackFactory<OrderApi> {
    @Override
    public OrderApi create(Throwable throwable) {
        return new OrderApi() {
            @Override
            public R findByUid(Integer id) {
                //收集异常
                throwable.printStackTrace();

                return R.error().putMsg("feign降级-factory....");
            }
        };
    }
}
